<?php
    session_start();
    include_once '../../../../controlador/php/conexion/Conexion.php';
    
    
    $fun = $_REQUEST['funcionario'];
    $proc = $_REQUEST['procedencia'];
    $ase = $_REQUEST['asegurador'];
    $doc = $_REQUEST['docpaciente'];
    $pac = $_REQUEST['paciente'];
    $eda = $_REQUEST['edad']/*." ".$_REQUEST['edad2']*/;
    $dig = $_REQUEST['diagnostico'];
    $sr = $_REQUEST['txtradop'];
    $observ = $_REQUEST['observ'];
    $med = $_REQUEST['med'];
    $pro = $_REQUEST ['pro'];
    $oideps = $_REQUEST ['oideps'];
    $pq = $_REQUEST ['pq'];
    $cargof = $_REQUEST ['cargof'];
    $oidr = $_REQUEST ['oidr'];
    
    $con = new Conexion();
    
    /*$oid = "select rem_oid from remisionNO where rem_docPac='".$doc."'";
    $oi = $con->query($oid);
    while ($res = mssql_fetch_array($oi)){
        
        $oidp = $res['rem_oid'];
        
    }*/
    
    $edi = "update remisionNO
            set rem_fecha = GETDATE(),
                rem_fHora = GETDATE(),
                rem_funcion = '".$fun."',
                rem_procede = '".$proc."',
                rem_aseg = '".$ase."',
                rem_edad = '".$eda."',
                rem_docPac = '".$doc."',
                rem_nomPac = '".$pac."',
                rem_diagnos = '".$dig."',
                rem_admi = '".$sr."',
                rem_observ = '".$observ."',
                genMedico = '".$med."',
                oid_pro = '".$pro."',
                oid_eps = '".$oideps."',
                rem_pnr = '".$pq."',
                rem_cargof = '".$cargof."',
                usu_oid = ".$_SESSION['usuario']."
            where rem_oid = '".$oir."'";
    $con->query($edi);
    $con->cerrarConexion();

    $lst = array('mensaje'=>'Los datos de la remision se editaron satisfactoriamente');
    print_r(json_encode($lst));
    
?>
